package com.oig.sys.auth.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.EntityListeners;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GenerationType;
import javax.persistence.GeneratedValue;
import java.io.Serializable;


/**
 * @author wuxl
 * 用户第三方账户信息
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_open_user")
@EntityListeners({AuditingEntityListener.class})
public class TbOpenUser implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 * 登录方式id
	 */
	@Column(name = "open_auth_id")
	private Integer openAuthId;

	/**
	 * 第三方的账户
	 */
	@Column(name = "open_user_acc")
	private String openUserAcc;

	/**
	 * 第三方的用户名
	 */
	@Column(name = "open_user_name")
	private String openUserName;

	/**
	 * 其他用户信息。
	 */
	@Column(name = "open_user_info")
	private String openUserInfo;

	/**
	 * 本系统的用户id，如果系统没有对应用户的信息，互联网系统应该注册。本系统是根据工号匹配用户，然后更新或新增用户信息
	 */
	@Column(name = "user_id")
	private Integer userId;
}
